﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using Lead2012.Models;
using Lead2012.ViewModels;
using Lead2012.Helpers;
using Lead2012.Business;

namespace Lead2012.Repository
{
    public class ActionWarehouseManagementRepository
    {
        // Create an instance of entities framework
        Lead2012Entities entities = new Lead2012Entities();

        // Quick action
        public void QuickAction(int leadId)
        {
            // Add logic here to add new action warehouse

            // Update lead information
            int actionTypeId = 0;
            string sqlQuery = string.Format("UPDATE [LeadWarehouse] SET [LastActionTypeId]={0}, [LastActionDate]='{1}' WHERE [LeadId]={2}", actionTypeId, DateTime.Now, leadId);
            int value = SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringProfile, CommandType.Text, sqlQuery);
        }
    }
}